package com.wan.net.rpc.service;

import net.sf.cglib.reflect.FastMethod;

import java.lang.reflect.InvocationTargetException;

/**
 * @author wwh
 * @date 2022/6/21 17:41
 */
public class ServiceProvider {
    /** 提供者 */
    private final Object provider;
    /** 指定方法调用器 */
    private final FastMethod fastMethod;

    public ServiceProvider(Object provider, FastMethod fastMethod) {
        this.provider = provider;
        this.fastMethod = fastMethod;
    }

    public Object invoke(Object[] args) throws InvocationTargetException {
        return fastMethod.invoke(provider,args);
    }
}
